import requests
import os
url="http://n.sinaimg.cn/news/crawl/117/w550h367/20220417/a3a9-08b2ca6dffe4210149dda424adf0734f.jpg"
response=requests.get(url)
if response.status_code==200:
    with open(os.path.expanduser("~/Desktop/photo.jpg"),"wb")as f:
        f.write(response.content)
    print("照片已保存在桌面！")
else:
    print("下载照片失败！")